using System;
using System.Collections;

namespace OracleInternal.Json.Binary
{
	internal class BitSet
	{
		private BitArray m_bits = new BitArray(256);

		internal BitSet()
		{
		}

		internal void Set(int bitIndex)
		{
			if (bitIndex < 0)
			{
				throw new IndexOutOfRangeException();
			}
			if (bitIndex >= m_bits.Count)
			{
				m_bits.Length += m_bits.Count + 8;
			}
			m_bits[bitIndex] = true;
		}

		internal bool Get(int bitIndex)
		{
			if (bitIndex < 0 || bitIndex >= m_bits.Count)
			{
				return false;
			}
			return m_bits[bitIndex];
		}

		internal void Clear()
		{
			m_bits.SetAll(value: false);
		}

		internal void Clear(int bitIndex)
		{
			if (bitIndex >= 0 || bitIndex < m_bits.Count)
			{
				m_bits[bitIndex] = false;
			}
		}
	}
}
